import request from '@/utils/request'


// 用户主页
export function getInfoByName(username, page, size) {
  return request({
    url: '/ums/user/' + username,
    method: 'get',
    params: {
      pageNo: page,
      size: size
    }
  })
}


export function getFollowByName(username, page, size) {
  return request({
    url: '/ums/user/follow/' + username,
    method: 'get',
    params: {
      pageNo: page,
      size: size
    }
  })
}

export function getFollowerByName(username, page, size) {
  return request({
    url: '/ums/user/follower/' + username,
    method: 'get',
    params: {
      pageNo: page,
      size: size
    }
  })
}

export function getInfo() {
    return request({
      url: '/ums/user/info',
      method: 'get'
    })
  }
  // 更新
  export function update(user) {
    
    return request({
      url: '/ums/user/update',
      method: 'post',
      data: user
    })
  }

  export function changePassword(pass) {
    console.log(2)
    return request({
      url: '/ums/user/changePassword',
      method: 'post',
      data: pass
    })
  }